home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIExternalHelperAppService.idl < prev    next >
Text File  |  2006-05-08  |  6KB  |  161 lines

  1. /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is the Mozilla browser.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications, Inc.
  20.  * Portions created by the Initial Developer are Copyright (C) 1999
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Scott MacGregor <mscott@netscape.com>
  25.  *
  26.  * Alternatively, the contents of this file may be used under the terms of
  27.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  28.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29.  * in which case the provisions of the GPL or the LGPL are applicable instead
  30.  * of those above. If you wish to allow use of your version of this file only
  31.  * under the terms of either the GPL or the LGPL, and not to allow others to
  32.  * use your version of this file under the terms of the MPL, indicate your
  33.  * decision by deleting the provisions above and replace them with the notice
  34.  * and other provisions required by the GPL or the LGPL. If you do not delete
  35.  * the provisions above, a recipient may use your version of this file under
  36.  * the terms of any one of the MPL, the GPL or the LGPL.
  37.  *
  38.  * ***** END LICENSE BLOCK ***** */
  39.  
  40. #include "nsICancelable.idl"
  41.  
  42. interface nsIURI;
  43. interface nsIRequest;
  44. interface nsIStreamListener;
  45. interface nsIFile;
  46. interface nsIMIMEInfo;
  47. interface nsIWebProgressListener2;
  48. interface nsIInterfaceRequestor;
  49.  
  50. /**
  51.  * The external helper app service is used for finding and launching
  52.  * platform specific external applications for a given mime content type.
  53.  */
  54. [scriptable, uuid(0ea90cf3-2dd9-470f-8f76-f141743c5678)]
  55. interface nsIExternalHelperAppService : nsISupports
  56. {
  57.   /**
  58.    * Binds an external helper application to a stream listener. The caller
  59.    * should pump data into the returned stream listener. When the OnStopRequest
  60.    * is issued, the stream listener implementation will launch the helper app
  61.    * with this data.
  62.    * @param aMimeContentType The content type of the incoming data
  63.    * @param aRequest The request corresponding to the incoming data
  64.    * @param aWindowContext Use GetInterface to retrieve properties like the
  65.    *                       dom window or parent window...
  66.    *                       The service might need this in order to bring up dialogs.
  67.    * @return A nsIStreamListener which the caller should pump the data into.
  68.    */
  69.   nsIStreamListener doContent (in ACString aMimeContentType, in nsIRequest aRequest,
  70.                                in nsIInterfaceRequestor aWindowContext); 
  71.  
  72.   /**
  73.    * Returns true if data from a URL with this extension combination
  74.    * is to be decoded from aEncodingType prior to saving or passing
  75.    * off to helper apps, false otherwise.
  76.    */
  77.   boolean applyDecodingForExtension(in AUTF8String aExtension,
  78.                                     in ACString aEncodingType);
  79.  
  80. };
  81.  
  82. /**
  83.  * This is a private interface shared between external app handlers and the platform specific
  84.  * external helper app service
  85.  */
  86. [scriptable, uuid(d0b5d7d3-9565-403d-9fb5-e5089c4567c6)]
  87. interface nsPIExternalAppLauncher : nsISupports
  88. {
  89.   /**
  90.    * mscott --> eventually I should move this into a new service so other
  91.    * consumers can add temporary files they want deleted on exit.
  92.    * @param aTemporaryFile A temporary file we should delete on exit.
  93.    */
  94.   void deleteTemporaryFileOnExit(in nsIFile aTemporaryFile); 
  95. };
  96.  
  97. /**
  98.  * A helper app launcher is a small object created to handle the launching
  99.  * of an external application.
  100.  *
  101.  * Note that cancelling the load via the nsICancelable interface will release
  102.  * the reference to the launcher dialog.
  103.  */
  104. [scriptable, uuid(99a0882d-2ff9-4659-9952-9ac531ba5592)]
  105. interface nsIHelperAppLauncher : nsICancelable
  106. {
  107.   /**
  108.    * The mime info object associated with the content type this helper app
  109.    * launcher is currently attempting to load
  110.    */
  111.   readonly attribute nsIMIMEInfo MIMEInfo;
  112.  
  113.   /**
  114.    * The source uri
  115.    */
  116.   readonly attribute nsIURI source;
  117.  
  118.   /**
  119.    * The suggested name for this file
  120.    */
  121.   readonly attribute AString suggestedFileName;
  122.  
  123.   /**
  124.    * Called when we want to just save the content to a particular file.
  125.    * NOTE: This will release the reference to the nsIHelperAppLauncherDialog.
  126.    * @param aNewFileLocation Location where the content should be saved
  127.    */
  128.   void saveToDisk(in nsIFile aNewFileLocation, in boolean aRememberThisPreference);
  129.  
  130.   /**
  131.    * Use aApplication to launch with this content.
  132.    * NOTE: This will release the reference to the nsIHelperAppLauncherDialog.
  133.    * @param aApplication nsIFile corresponding to the location of the application to use.
  134.    * @param aRememberThisPreference TRUE if we should remember this choice.
  135.    */
  136.   void launchWithApplication(in nsIFile aApplication, in boolean aRememberThisPreference);
  137.  
  138.   /**
  139.    * The following methods are used by the progress dialog to get or set
  140.    * information on the current helper app launcher download.
  141.    * This reference will be released when the download is finished (after the
  142.    * listener receives the STATE_STOP notification).
  143.    */
  144.   void setWebProgressListener(in nsIWebProgressListener2 aWebProgressListener);
  145.  
  146.   /**
  147.    * when the stand alone progress window actually closes, it calls this method
  148.    * so we can release any local state...
  149.    */
  150.   void closeProgressWindow();
  151.  
  152.   /**
  153.    * The file we are saving to
  154.    */
  155.   readonly attribute nsIFile targetFile;
  156.   /**
  157.    * Time when the download started
  158.    */
  159.   readonly attribute PRTime timeDownloadStarted;
  160. };
  161.